﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace PhysioAssist2Win
{
    /// <summary>
    /// Interaction logic for Agenda.xaml
    /// </summary>
    public partial class Agenda : Window
    {
        public Agenda()
        {
            InitializeComponent();



            //Ajusta posição e tamanho das janelas
            double width = System.Windows.SystemParameters.PrimaryScreenWidth;
            double height = System.Windows.SystemParameters.PrimaryScreenHeight;

            winAgenda.Width = width;
            winAgenda.Height = height;

            winAgenda.Left = 0;
            winAgenda.Top = 0;



            //Larguras dos Paineis
            pnlEsq.Width = winAgenda.Width * 0.2;
            pnlEsq.Height = winAgenda.Height;
            pnlEsq.Margin = new Thickness(20, 20, 0, 0);

            pnlDir.Width = winAgenda.Width * 0.8;
            pnlDir.Height = winAgenda.Height;
            pnlDir.Margin = new Thickness(20, 20, 0, 0);


            CarregaAgenda(DateTime.Now.Day, DateTime.Now.Month, DateTime.Now.Year, 10);//HARDCODE



        }



        private void CarregaAgenda(int dia, int mes, int ano, int profissional)
        {

            WS.WSSoapClient client = new WS.WSSoapClient();
            WS.Agenda[] lst = client.ListaAgenda(dia, mes, ano, profissional);

            foreach (WS.Agenda age in lst)
            {

                Label lbl = new Label();

                lbl.Content = age.dia + "/" + age.mes + "/" + age.ano + " " + age.hora + " - " + age.compromisso;
                lbl.FontSize = 40;
                pnlDir.Children.Add(lbl);

            }
        }

        private void Image_MouseDown_1(object sender, MouseButtonEventArgs e)
        {
            winAgenda.Close();
        }

        private void pnlEsq_MouseDown(object sender, MouseButtonEventArgs e)
        {
            winAgenda.Close();
        }





    }
}
